package request

// CreatePrescriptionReq 创建开药申请请求
type CreatePrescriptionReq struct {
	PatientID  uint `json:"patient_id" binding:"required"`
	DoctorID   uint `json:"doctor_id" binding:"required"`
	ScheduleID uint `json:"schedule_id" binding:"required"`
	VisitType  int  `json:"visit_type" binding:"required,oneof=初诊 复诊"`
}

// AddMedicineReq 添加药品请求
type AddMedicineReq struct {
	MedicineId int64  `json:"medicineId" binding:"required"`
	Quantity   int    `json:"quantity" binding:"required"`
	Dosage     string `json:"dosage"` // 用法用量
}

// SelectPrescriptionDoctorReq 选择开药医生请求
type SelectPrescriptionDoctorReq struct {
	DoctorId int64 `json:"doctorId" binding:"required"`
}

// DoctorCreatePrescriptionReq 医生创建处方请求
type DoctorCreatePrescriptionReq struct {
	ConsultationId int64              `json:"consultationId" binding:"required"`
	PatientId      int64              `json:"patientId" binding:"required"`
	Diagnosis      string             `json:"diagnosis" binding:"required"` // 诊断
	Items          []PrescriptionItem `json:"items" binding:"required"`
}

// PrescriptionItem 处方项
type PrescriptionItem struct {
	MedicineId   int64  `json:"medicineId" binding:"required"`
	MedicineName string `json:"medicineName" binding:"required"`
	Quantity     int    `json:"quantity" binding:"required"`
	Dosage       string `json:"dosage" binding:"required"` // 用法用量
}

// UpdatePrescriptionReq 更新处方请求
type UpdatePrescriptionReq struct {
	Diagnosis string             `json:"diagnosis"`
	Items     []PrescriptionItem `json:"items"`
}

// ==================== 请求结构体定义 ====================

type UploadPrescriptionReq struct {
	PrescriptionID uint64 `json:"prescription_id" binding:"required"`
	ImageURL       string `json:"image_url" binding:"required"`
}

type RemoveMedicineReq struct {
	PrescriptionID uint64 `json:"prescription_id" binding:"required"`
	MedicineID     uint64 `json:"medicine_id" binding:"required"`
}

type SelectDoctorReq struct {
	PrescriptionID uint64 `json:"prescription_id" binding:"required"`
	DoctorID       uint64 `json:"doctor_id" binding:"required"`
}
